package com.anolesoft.yr.mbus.code.service.gene;

import com.anolesoft.yr.mbus.code.dto.CodeItemDTO;
import com.anolesoft.yr.mbus.code.dto.CodeMainDTO;

/**
 * @author zhj
 * @date 2020/9/25 9:23
 */
public interface SequenceBuilder {
    /**
     * 获取序列号
     * @param codeMain codemain
     * @param codeItem codeitem
     * @param indiId indiid
     * @return String
     */
    String getSequence(CodeMainDTO codeMain, CodeItemDTO codeItem, String indiId);

    /**
     *构建rediskey
     * @param codeMain codemain
     * @param indiId indiid
     * @return String
     */
    static String builderKey(CodeMainDTO codeMain, String indiId){
        return KEY_PREFIX + codeMain.getObjuid() + ":" + indiId;
    }

    static final String KEY_PREFIX = "code:";
}
